package com.gxa.shop.service.prodect.impl;

import com.gxa.shop.bean.dto.ProductQueryPage;
import com.gxa.shop.bean.pojo.Product;
import com.gxa.shop.bean.vo.ProductOption;
import com.gxa.shop.bean.vo.ProductVo;

import com.gxa.shop.dao.product.ProductDao;
import com.gxa.shop.dao.product.impl.ProductDaoImpl;
import com.gxa.shop.service.prodect.ProductService;


import java.util.Collections;
import java.util.List;

/**
 * com.gxa.shop.bean.service.impl
 * User: zjy
 * Date: 2024/12/19 15:32
 * motto:   逆水行舟不进则退
 * Description:
 * Version: V1.0
 */
public class ProductServiceImpl implements ProductService {
    private ProductDao productDao=new ProductDaoImpl();
    @Override
    public Product queryById(Integer productId) {
        return null;
    }

    @Override
    public boolean insert(Product product) {

        return productDao.insert(product)>0;
    }

    @Override
    public boolean update(Product product) {

        return productDao.update(product)>0;
    }

    @Override
    public boolean deleteById(Integer productId) {
        return productDao.deleteById(productId)>0;
    }

    @Override
    public List<ProductOption> findByPage(ProductQueryPage productQueryPage) {
        return productDao.findByPage(productQueryPage);
    }

    @Override
    public Long findByTotal(ProductQueryPage productQueryPage) {
        return   productDao.findByTotal(productQueryPage);
    }

    @Override
    public List<ProductOption> findAllList() {
        return null;
    }

    @Override
    public List<ProductVo> queryByCategoryId(Integer categoryId) {
        return productDao.queryByCategory(categoryId);
    }

    @Override
    public ProductVo queryByProductId(String productId) {
        return productDao.queryById(productId);
    }

    @Override
    public List<ProductVo> findByName(String name) {
        return productDao.findByName(name);
    }
}